﻿@model EnterpriseFund.Model.TaxAuditAdjust
@using System.Linq;
@{
    List<EnterpriseFund.Model.FinanceProp> financePropList = ViewData["financePropList"] != null ? (ViewData["financePropList"] as List<EnterpriseFund.Model.FinanceProp>) : new List<EnterpriseFund.Model.FinanceProp>();
    List<EnterpriseFund.Model.EnterpriseFinanceProp> enterpriseFinancePropList = ViewData["enterpriseFinancePropList"] != null ? (ViewData["enterpriseFinancePropList"] as List<EnterpriseFund.Model.EnterpriseFinanceProp>) : new List<EnterpriseFund.Model.EnterpriseFinanceProp>();
    Layout = null;
}
<!DOCTYPE html>
<html>
@Html.Partial("LoadPanelPartial")
<head>
    <title></title>
    @if (false)
    { 
        <script src="../../Scripts/jquery-vsdoc.js" type="text/javascript"></script>
        <script src="../../Scripts/ASPxScriptIntelliSense.js" type="text/javascript"></script>
    }
    <link href="@Url.Content("~/Content/Site.css", true)" rel="stylesheet" type="text/css" />

    <script src="@Url.Content("~/Scripts/jquery.min.js", true)" type="text/javascript"></script>
    <script src="@Url.Content("~/Common/GetRootPath.ashx", true)" type="text/javascript"></script>

    @Html.DevExpress().GetStyleSheets(

        new StyleSheet { ExtensionType = ExtensionType.ListBox, Theme = DevExpressHelper.Theme }
)
    @Html.DevExpress().GetScripts(
        new Script { ExtensionType = ExtensionType.ListBox }
)


    <script type="text/javascript">
        function OK() {

            lpModal.Show();
            var fTaxClassAllowanceNo = FTaxClassAllowanceNo.GetValue();
            var rkrq = RKRQ.GetDate();
            var fAdjustAmount = FAdjustAmount.GetText();
            var fNote = FNote.GetText();

            if (pd(fTaxClassAllowanceNo, rkrq, fAdjustAmount)) {
                fTaxClassAllowanceNo = ASPxClientUtils.Trim(fTaxClassAllowanceNo);
                rkrq = ASPxClientUtils.Trim(RKRQ.GetText());
                fAdjustAmount = ASPxClientUtils.Trim(fAdjustAmount);

                $.ajax({
                    type: 'POST',
                    url: rootPath + '/TaxAuditForm/TaxAuditAdjustSave',
                    data: { fTaxClassAllowanceNo: fTaxClassAllowanceNo, rkrq: rkrq, fAdjustAmount: fAdjustAmount, fNote: fNote },
                    success: function (result) {
                        lpModal.Hide();
                        if (result == "exists") {
                            tbCodeNo.SetErrorText("编码已存在");
                            tbCodeNo.SetIsValid(false);
                        } else if (result == "ok") {
                            parent.codeOK();
                        } else if (result == "error") {
                            alert("保存失败");
                        }
                    }
                });

            } else {
                lpModal.Hide();
            }

        }


        function pd(fTaxClassAllowanceNo, rkrq, fAdjustAmount) {
            var bl = true;
            if (null == fTaxClassAllowanceNo || ASPxClientUtils.Trim(fTaxClassAllowanceNo) == "") {
                FTaxClassAllowanceNo.SetErrorText("请选择可补贴税种");
                FTaxClassAllowanceNo.SetIsValid(false);
                bl = false;
            }
            if (null == rkrq || ASPxClientUtils.Trim(rkrq) == "") {
                RKRQ.SetErrorText("请填写入库日期");
                RKRQ.SetIsValid(false);
                bl = false;
            }

            if (null == fAdjustAmount || ASPxClientUtils.Trim(fAdjustAmount) == "") {
                FAdjustAmount.SetErrorText("请填写调整金额");
                FAdjustAmount.SetIsValid(false);
                bl = false;
            }

            return bl;
        }

    </script>

</head>
<body>
    <table class="tableFrom" width="100%">
        <tr>
            <td>
               税种:</td>
            <td>
               @Html.DevExpress().ComboBox(settings =>
               {
                   settings.Name = "FTaxClassAllowanceNo";
                   settings.Width = 180;
                   settings.Properties.DropDownStyle = DropDownStyle.DropDownList;
                   settings.Properties.TextField = "FTaxClassAllowanceName";
                   settings.Properties.ValueField = "FTaxClassAllowanceNo";
               }).BindList(ViewData["TaxClassAllowanceList"]).Bind(Model.FTaxClassAllowanceNo).GetHtml()
            </td>
        </tr>
        <tr>
            <td>
                入库日期:</td>
            <td>
               @Html.DevExpress().DateEdit(settings =>
               {
                   settings.Name = "RKRQ";
                   settings.Width = 180;
                   settings.Date = Model.RKRQ;


                   settings.Properties.EditFormat = EditFormat.Date;
                   settings.Properties.EditFormatString = "yyyy-MM-dd";
                   settings.Properties.MinDate = DateTime.Parse("1900-01-01");
                   settings.Properties.ValidationSettings.ErrorDisplayMode = ErrorDisplayMode.ImageWithText;
                   settings.Properties.ValidationSettings.EnableCustomValidation = true;
                   settings.Properties.UseMaskBehavior = true;
               }).GetHtml()
            </td>
        </tr>
        <tr>
        <td>调整金额:</td>
        <td>@Html.DevExpress().TextBox(settings1 =>
       {
           settings1.Name = "FAdjustAmount";
           settings1.Text = Model.FAdjustAmount.ToString();
           settings1.Width = 180;
           settings1.Properties.EnableClientSideAPI = true;
       }).GetHtml()</td>
        </tr>
         <tr>
        <td>调整原因:</td>
        <td>@Html.DevExpress().Memo(settings1 =>
       {
           settings1.Name = "FNote";
           settings1.Text = Model.FNote;
           settings1.Width = 180;
           settings1.Properties.Rows = 6;
           settings1.Properties.EnableClientSideAPI = true;
       }).GetHtml()</td>
        </tr>
    </table>

    <script>
        lp.Hide();
    </script>

</body>
</html>
